/**
 * \class TcpdumpHeader
 *
 * Start Date and Time
 *Duration of captured packet
 *Total packets
 *Average, minimum, and maximum packet sizes.
 */

#include "iu_wiretap.h"
#ifndef TCPDUMPHEADER_H_
#define TCPDUMPHEADER_H_
using namespace std;

class TcpdumpHeader
{
public:
  static time_t lastPacketTime_;
  static time_t lastPacketTimeD_;
  static time_t firstPacketTime_;
  static time_t firstPacketTimeU_;
  /**
   * This is a construct for Tcp header
   */
  TcpdumpHeader();
  /**
   * This function analyze a tcp dump packet
   */
  static Protocol
  handlePacket(const struct pcap_pkthdr *header);
  /**
   * This function print out the start and en time of packet
   */
  static string
  printTime(const struct pcap_pkthdr *header);
  /**
   * This function compute  time interval between two packets
   */
  static string
  timeDuration(time_t nextPacket, time_t nextPacketU, time_t currentPacket,
      time_t currentPacketU);
  static string
  getFinalInfo();

  /**
   * This is a destructor for Tcp header
   */
  virtual
  ~TcpdumpHeader();
  static int totalPacket_;
private:
  // static time_t lastPacketTime_;
  //static time_t lastPacketTimeD_;
  //static time_t firstPacketTime_;

  static int average_;
  static int max_;
  static int min_;
};

#endif /* TCPDUMPHEADER_H_ */
